package cn.angis.common.constant;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 包名称：cn.angis.common.constant
 * 类名称：Constant
 * 类描述：全局常量
 * 创建人：@author angis.cn
 * 创建日期： 2023/1/5 20:25
 */
public class Constant {
    public static final String CACHE_PRE = "angis:";
    public static final String SESSION_USER_KEY = CACHE_PRE + "user";
    public static final String SESSION_USER_ID = CACHE_PRE + "userid";
    public static final String SESSION_DEPT_ID = CACHE_PRE + "deptid";
    public static final String SESSION_LOGIN_NAME = CACHE_PRE + "loginname";
    public static final String SESSION_USER_NAME = CACHE_PRE + "username";
    public static final String LOGIN_ERROR_NUMBER = CACHE_PRE + "login_error";
    public static final String ENABLE = "0";
    public static final String DISABLE = "1"; //目录
    public static final String MENU = "2"; //菜单
    public static final String BUTTON = "3"; //按钮
    public static final String COMMON_PARENT_ID = "0";
    public static final String REDIS_CAPTCHA_KEY = CACHE_PRE + "user:captcha:";
    public static final String ROUTER_LAYOUT = "Layout";
    public static final String ROUTER_PARENT_VIEW = "ParentView";
    public static final String SESSION_OPENID_KEY = CACHE_PRE + "openid";
    public static final String PAY_SUB_KEY = CACHE_PRE + "submerchant";

    public static final String CACHE_DICT_MAP = CACHE_PRE + "allmapdict";
    public static final long USER_LOCK_TIME = 6 * 60 *60;
    public static final Map<String, String> OPERAMAP = new HashMap<String, String>() {
        {
            put("page", "分页查询");
            put("save", "新增");
            put("update", "修改");
            put("del", "删除");
        }
    };

    public static final String IP_UNKNOWN = "unknown";

    public static final String SERVER_HTTP = "https://";
    public static final String STREAM_PORT = ":1846";
    public static final String STREAM_LIST = "/api/v1/streams/";
    public static final String STREAM_IP = "www.aipix.cn";
    public static final String STREAM_SERVER_URL = SERVER_HTTP + STREAM_IP + STREAM_PORT;

    public static final String WS_0 = "0"; //无人机实时数据
    public static final String WS_1 = "1"; //前端请求实时定位
    public static final String WS_2 = "2"; //前端取消实时定位
    public static final String WS_3 = "3"; //前端控制无人机
    public static final String WS_4 = "4"; //前端发送航线
    public static final String WS_5 = "5"; //无人机发送型号和sn
    public static final String CHANNL_DRONE_MSG = "drone_msg";

    public static final ConcurrentHashMap fontSessionMap = new ConcurrentHashMap();
    public static final ConcurrentHashMap backSessionMap = new ConcurrentHashMap();

    /**
     * 定时任务白名单配置（仅允许访问的包名，如其他需要可以自行添加）
     */
    public static final String[] JOB_WHITELIST_STR = { "cn.angis.quartz.task" };

    /**
     * 定时任务违规的字符
     */
    public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
            "org.noear", "org.apache", "cn.angis.common.util", "cn.angis.common.config", "cn.angis.generate" };

    /**
     * RMI 远程方法调用
     */
    public static final String LOOKUP_RMI = "rmi:";

    /**
     * LDAP 远程方法调用
     */
    public static final String LOOKUP_LDAP = "ldap:";

    /**
     * LDAPS 远程方法调用
     */
    public static final String LOOKUP_LDAPS = "ldaps:";

    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";
}
